import json
import pandas as pd

from pyecharts import Line
import numpy as np

#
# attr = ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
# v1 = [5, 20, 36, 10, 10, 100]
# v2 = [55, 60, 16, 20, 15, 80]
# line = Line("DVR Dual Camera Testing")
# line.add("商家A", attr, v1, mark_point=["average"])
# line.add("商家B", attr, v2, is_smooth=True, mark_line=["max", "average"])
# opt = line.get_options()
# line.show_config()
# line.render()

# index = np.array(
#     ['22:37:39.965', '22:37:48.655', '22:38:24.314'])
#
# index2 = np.array(
#     ['22:37:39.111', '22:37:48.222', '22:38:24.314'])
#
# v1 = np.random.random(index.size)
# v2 = np.random.random(index2.size)
#
# line = Line('DVR Dual Camera')
# line.add('camera-0:sync', index, v1, is_smooth=True)
# line.add('camera-0:async', index2, v2)
# line.render()


d1 = {
    'Cam-0-sync': pd.Series([1, 3, 5], index=['1', '3', '5']),
}

d2 = {
    'Cam-0-sync': pd.Series([2, 4, 6], index=['2', '4', '6']),
}

df0 = pd.DataFrame()
df1 = pd.DataFrame(d1)
df2 = pd.DataFrame(d2)

df = pd.concat([df1, df2], sort=True)

print(df1)
print(df2)
print(df)
print(df)
